<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* flex-wrap:nowrap | wrap  设置flex布局子元素的换行*/
        .parent{
            width: 500px;
            height: 300px;
            background: red;
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
        }
        .parent div{
            width: 100px;
            height: 100px;
            border: 1px solid #333;
        }
    </style>
</head>
<body>
    <div class="parent">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
    </div>
</body>
</html>